/**
 * 作者: wgx
 * 日期: 2024-11-13 11:17:41
 * 备注: 派对参与奖励配置表
 */
package com.motu.monstercity.server.game.commondata.feast;
import com.motu.monstercity.server.game.base.CommonUtils;
import com.motu.monstercity.server.game.commondata.bag.ItemId;
import com.motu.monstercity.server.game.logic.RewardItem;
import io.vertx.core.json.JsonObject;

import java.util.List;

public class FeastJoin extends FeastJoinModel {
    public FeastJoin(JsonObject obj) {
        super(obj);
    }

    // 这个参加类型的积分
    public int takeFeastScore() {
        int score = 0;
        try {
            List<RewardItem> rewardItemList = CommonUtils.takeReawrdItemFromStr(getReward());
            for (RewardItem rewardItem : rewardItemList) {
                if (rewardItem.getItemId() == ItemId.FEAST_SCORE) {
                    return (int) rewardItem.getItemNum();
                }
            }
        } catch (Exception e) {
        }
        return score;
    }
}
